package com.javabasic.algorithm.leetcode;

import org.junit.Test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Author xiongmin
 * @Description TODO
 * @Date 2019/10/28 12:47
 * @Version 1.0
 **/
public class RegularExpressionMatching {

    @Test
    public void test() {

    }

    public boolean isMatch(String s, String p) {
        Pattern pattern = Pattern.compile(p);
        Matcher matcher = pattern.matcher(s);
        if (matcher.find()) {
//            System.out.println("true");
            return true;
        } else {
//            System.out.println("false");
            return false;
        }
    }
}
